package com.gregbugaj.nscaffold.transformers;


import java.util.ArrayList;
import java.util.List;

import com.gregbugaj.nscaffold.domain.Keyword;
import com.gregbugaj.nscaffold.domain.Product;
import com.gregbugaj.nscaffold.node.PClass;
import com.gregbugaj.nscaffold.node.PropertyInfo;
import com.gregbugaj.nscaffold.type.PType;

public class DummyTransformer implements Transformer {
	private List<PClass> classMappings;

	public DummyTransformer(){
		classMappings=new ArrayList<PClass>();
	}

	@Override
	public void transform() {
		PClass pc=new PClass();
		pc.setEntityName(Keyword.class.getSimpleName());

		PropertyInfo propertyA=new PropertyInfo();
		propertyA.setPropertyName("ID");
		propertyA.setType(PType.IntegerType); 

		
		pc.addProperty(propertyA);

		PropertyInfo property=new PropertyInfo();
		property.setPropertyName("COL_A");
		property.setType(PType.StringType);
		pc.addProperty(property);

		PropertyInfo propKeyRef=new PropertyInfo();
		propKeyRef.setPropertyName("PRODUCT_ID");
		propKeyRef.setType(PType.IntegerType);
		
		pc.addProperty(propKeyRef);

		PClass pcProduct=new PClass();
		pcProduct.setEntityName(Product.class.getSimpleName());

		PropertyInfo propA=new PropertyInfo();
		propA.setPropertyName("ID");
		propA.setType(PType.IntegerType);

		PropertyInfo propB=new PropertyInfo();
		propB.setPropertyName("NAME");
		propB.setType(PType.StringType);
		
		

		PropertyInfo propertyRef=new PropertyInfo();
		propertyRef.setPropertyName("KEYWORDS");
		propertyRef.setType(PType.IntegerType); 
		
		pcProduct.addProperty(propertyRef);
		
		pcProduct.addProperty(propA);
		pcProduct.addProperty(propB);

		classMappings.add(pcProduct);
		classMappings.add(pc);

	}

	@Override
	public List<PClass> getClassMappings() {
		return classMappings;
	}

}
